package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GoodscommentsMapper;
import com.ruoyi.system.domain.Goodscomments;
import com.ruoyi.system.service.IGoodscommentsService;

/**
 * 商品评论表Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-25
 */
@Service
public class GoodscommentsServiceImpl implements IGoodscommentsService 
{
    @Autowired
    private GoodscommentsMapper goodscommentsMapper;

    /**
     * 查询商品评论表
     * 
     * @param goodscommentsId 商品评论表主键
     * @return 商品评论表
     */
    @Override
    public Goodscomments selectGoodscommentsByGoodscommentsId(String goodscommentsId)
    {
        return goodscommentsMapper.selectGoodscommentsByGoodscommentsId(goodscommentsId);
    }

    /**
     * 查询商品评论表列表
     * 
     * @param goodscomments 商品评论表
     * @return 商品评论表
     */
    @Override
    public List<Goodscomments> selectGoodscommentsList(Goodscomments goodscomments)
    {
        return goodscommentsMapper.selectGoodscommentsList(goodscomments);
    }

    /**
     * 新增商品评论表
     * 
     * @param goodscomments 商品评论表
     * @return 结果
     */
    @Override
    public int insertGoodscomments(Goodscomments goodscomments)
    {
        goodscomments.setGoodscommentsId(IdUtils.randomUUID());
        goodscomments.setCreateTime(DateUtils.getNowDate());
        return goodscommentsMapper.insertGoodscomments(goodscomments);
    }

    /**
     * 修改商品评论表
     * 
     * @param goodscomments 商品评论表
     * @return 结果
     */
    @Override
    public int updateGoodscomments(Goodscomments goodscomments)
    {
        return goodscommentsMapper.updateGoodscomments(goodscomments);
    }

    /**
     * 批量删除商品评论表
     * 
     * @param goodscommentsIds 需要删除的商品评论表主键
     * @return 结果
     */
    @Override
    public int deleteGoodscommentsByGoodscommentsIds(String[] goodscommentsIds)
    {
        return goodscommentsMapper.deleteGoodscommentsByGoodscommentsIds(goodscommentsIds);
    }

    /**
     * 删除商品评论表信息
     * 
     * @param goodscommentsId 商品评论表主键
     * @return 结果
     */
    @Override
    public int deleteGoodscommentsByGoodscommentsId(String goodscommentsId)
    {
        return goodscommentsMapper.deleteGoodscommentsByGoodscommentsId(goodscommentsId);
    }
}
